Page({

    /**
     * 页面的初始数据
     */
    data: {
        leftItems: [
            {
                id: 'g0',
                name: '家居生活'
            }, {
                id: 'g1',
                name: '家居生活1'
            }, {
                id: 'g2',
                name: '家居生活2'
            }, {
                id: 'g3',
                name: '家居生活3'
            }, {
                index: 4,
                id: 'g4',
                name: '家居生活4'
            }, {
                id: 'g5',
                name: '家居生活5'
            }, {
                id: 'g6',
                name: '家居生活6'
            }, {
                id: 'g7',
                name: '家居生活7'
            }, {
                id: 'g8',
                name: '家居生活8'
            }, {
                id: 'g9',
                name: '家居生活9'
            }, {
                id: 'g10',
                name: '家居生活10'
            }, {
                id: 'g11',
                name: '家居生活11'
            }

        ],
        rightItem: ''
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function (options) {
         this.setData({
                rightItem: this.data.leftItems[0].id
            })
          
    },

    lefftScroll: function (e) {
        this.setData({
            rightItem: e.currentTarget.dataset.id
        })
        console.log(this.data.rightItem)
    },
    toHotSale: function () {
        wx.navigateTo({
            url: '../sale-hot/sale-hot' // 指定页面的url
        });
    },
    toSecondClassify: function () {
        wx.navigateTo({
            url: '../second-classify/second-classify?type=0' // 指定页面的url
        });
    },
    toBrandIndex: function () {
        wx.navigateTo({
            url: '../second-classify/second-classify?type=1' // 指定页面的url
        });
    }
})